<template>
    <div>
        <el-tabs v-model="activeName" type="card" @tab-click="handleClick(activeName)">
            <el-tab-pane label="开店审核" name="first"></el-tab-pane>
            <el-tab-pane label="提现审核" name="second"></el-tab-pane>
            <el-tab-pane label="信息审核" name="third"></el-tab-pane>
        </el-tabs>
        <el-row style="margin-top: 20px;">
            <el-form ref="search_form" :model="search_form" label-width="80px">
                <el-col :span="4"> <el-form-item label="订单编号">
                        <el-input v-model="search_form.order_number"></el-input>
                    </el-form-item></el-col>
                <el-col :span="5">
                    <el-form-item label="活动区域">
                        <el-select v-model="search_form.region" placeholder="请选择活动区域">
                            <el-option label="区域一" value="shanghai"></el-option>
                            <el-option label="区域二" value="beijing"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="4">
                    <el-date-picker v-model="search_form.order_time" type="date" placeholder="下单时间">
                    </el-date-picker>
                </el-col>
                <el-col :span="4"> <el-button type="primary" @click="search_Bth">搜索</el-button>
                    <el-button>重置</el-button></el-col>
                <!-- <el-col :span="2"> </el-col> -->
            </el-form>
        </el-row>
        <el-row>
            <el-col>
                <div class="app-container">
                    <el-table  :data="tableData" border fit highlight-current-row
                        style="width: 100%">
                        <el-table-column prop="application_id" label="id" width="180">
                        </el-table-column>
                        <el-table-column prop="application_name" label="名称" width="180">
                        </el-table-column>
                        <el-table-column prop="application_number" label="申请单号">
                        </el-table-column>
                        <el-table-column prop="operator" label="操作人">
                        </el-table-column>
                        <el-table-column prop="operator_time" label="操作时间">
                        </el-table-column>
                        <el-table-column prop="store_id" label="店家名">
                        </el-table-column>
                        <el-table-column prop="time" label="审核提交时间">
                        </el-table-column>
                        <el-table-column align="center" fixed="right" label="操作">
                        <template slot-scope="{ row }">
                            <el-button  type="text" size="small"
                                @click="rowClick(row)">详情</el-button>
                        </template>
                    </el-table-column>
                    </el-table>
                    <!-- <Pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
                        @pagination="getList" /> -->
                </div>
            </el-col>
        </el-row>
    </div>
</template>

<script>
import { Auditing_list } from "@/api/Auditing"
import { timestampToTime } from "@/utils"
import { mapState } from 'vuex'
export default {
    data() {
        return {
            page: 1,
            tableData: [],
            search_form: {},
            activeName: 'first',
            tabSelect: {
                code_: '开店',
                status: ""
            },
        }
    },
    methods: {
        rowClick(row) {
            debugger
            console.log(row,'rowClick')
            if(this.tabSelect.code_ == '开店'){
                this.$router.push({
                path: "/withdrawal/details",
                query:{
                    application_number:row.application_number,
                    code_:this.tabSelect.code_
                }
            })
            }if(this.tabSelect.code_ == '提现'){
                this.$router.push({
                path: "/withdrawal/withdrawalDetail",
                query:{
                    application_number:row.application_number,
                    code_:this.tabSelect.code_
                }
            })
            }
      
        },
        handleClick(activeName) {
            this.activeName = activeName;
            if (this.activeName == "first") {
                this.tabSelect.code_ = '开店'
            } else if (this.activeName == "second") {
                this.tabSelect.code_ = '提现'
            } else {
                this.tabSelect.code_ = '信息'
            }
            this.getList()
        },
        search_Bth() {
            console.log(this.search_form, 'search_form')
        },
        getList() {
            console.log(this.regionalData, 'regionalData')
            let params = {
                code_: this.tabSelect.code_,
                status: this.tabSelect.status,
                ...this.regionalData,

            }
            Auditing_list(params).then(res => {
                res.result.forEach(item => {
                    item.operator_time = timestampToTime(item.operator_time)
                    item.time = timestampToTime(item.time)
                });
                this.tableData = res.result
                // console.log(this.tableData, 'this.dataList')
            })
        },
    },
    computed: {
        ...mapState('user', { regionalData: "regionalData" })
    },
    mounted() {
        this.getList()
    },
} 
</script>

<style></style>